<style>
	#announcement_search table {
		border-collapse:collapse;
		font-size: 0.9em;
	}
	
	#announcement_search .announcement:hover {
		background-color: #dddddd;
		cursor: pointer;
	}
	
	#announcement_search .announcement td {
		border:1px solid #cccccc;
	}
	
	.announcement .act:hover,
	.announcement .del:hover 
	{
		background-color: red;
		color: #ffffff;
	}

</style>
<script>
	$(function(){
		$('.preview').imgPreview();
	});
	
</script>
<div id="announcement_search">
	<div><b>{{ infos.notActivated }}</b> not activated / Total <b>{{ infos.total }}</b> announcements.</div>
	<table width="100%">
		<thead>
			<tr>
				<td></td>
				<td>Photo</td>
				<th>Id</th>
				<th>Title</th>
				<th>createdAt</th>
				<th>activatedAt</th>
				<th>validatedAt</th>
				<th>beginsAt</th>
				<th>expiresAt</th>
				<th>updatedAt</th>
				<th>Del</th>
			</tr>
		</thead>
		<tbody>
		{% for announcement in announcements %}
			<tr class="announcement" id="announcement_{{announcement.id}}">
				<td title="Activate" width="10px" align="center" class="act" onClick="validateAnnouncement({{announcement.id}});" id="validate_{{announcement.id}}">{{ (announcement.validatedAt) ? 'V' : '-' }}</td>
				<td width="60px" align="center">
					<span>
						<a class="preview" href="{{asset('images/announcement/photo/' ~ announcement.photos ~ '.jpg')}}">
							<img width="60px" height="40px" src="{{ (announcement.photos != NULL) ? asset('images/announcement/thumb/' ~ announcement.photos ~ '.jpg' ) : asset('images/announcement/thumb/noThumb80x60.jpg') }}" />
						</a>
					</span>
				</td>
				<td width="10px">{{ announcement.id }}</td>
				<td>{{ announcement.title }}</td>
				<td width="70px" align="center">{{ (announcement.createdAt != NULL) ? announcement.createdAt | date('Y-m-d H:i:s') : '-' }}</td>
				<td width="70px" align="center">{{ (announcement.activatedAt != NULL) ? announcement.activatedAt | date('Y-m-d H:i:s') : '-' }}</td>
				<td width="70px" align="center" id="validatedAt_{{announcement.id}}">{{ (announcement.validatedAt != NULL) ? announcement.validatedAt | date('Y-m-d H:i:s') : '-' }}</td>
				<td width="70px" align="center">{{ (announcement.beginsAt != NULL) ? announcement.beginsAt | date('Y-m-d H:i:s') : '-' }}</td>
				<td width="70px" align="center">{{ (announcement.expiresAt != NULL) ? announcement.expiresAt | date('Y-m-d H:i:s') : '-' }}</td>
				<td width="70px" align="center">{{ (announcement.updatedAt != NULL) ? announcement.updatedAt | date('Y-m-d H:i:s') : '-' }}</td>
				<td width="10px" align="center" class="del" onClick="deleteAnnouncement({{announcement.id}});" id="delete_{{announcement.id}}"><img src="{{ asset('images/iconDelete.gif') }}" /></td>
			</tr>
		{% endfor %}
		</tbody>
	<table>
</div>